<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
          /* 
          函数是可以互相调用的          
        */
        // 买土豆
        function buy(shopping) {
            console.log('去超市');
            if (shopping == '土豆') {
                console.log('挑选土豆');
                shopping = '土豆';
            } else if(shopping == '辣椒'){
                console.log('挑选辣椒');
                shopping = '辣椒';
            }else{
                console.log('挑选鸡蛋');
                shopping = '鸡蛋';
            }
            return shopping;
        }
        //  土豆炖牛腩
        function beff(){
            let potato = buy('土豆');
            console.log('切'+potato);
            console.log('切牛肉');
            console.log('炒菜');
            console.log('土豆牛腩做好啦');
        }
        // 西红柿炒鸡蛋
        function tomato(){
            let pepper = buy('辣椒');
            let egg = buy('鸡蛋');
            console.log('炒'+pepper+egg);
            console.log('辣椒鸡蛋炒好啦');
        }
        tomato();
        beff();


        // 吃饭，逛街，打游戏，看电影，做饭
        // 吃饭
        function eat(){
            console.log('早餐吃包子豆浆');
            console.log('午餐吃鸡腿面条');
            console.log('晚餐吃鸡蛋面条');
        }
        // 逛街
        function shoppings(){
            console.log('白天去超市');
            console.log('傍晚去夜市');
        }
        // 打游戏
        function play(game){
            console.log('白天'+game);
            console.log('晚上打'+game);
        }
        // 看电影
        function movie(){
            console.log('陪兄弟不看');
            console.log('陪对象看各种电影');
        }
        // 做饭
        function cooking(food){
            console.log('早餐做'+food);
            console.log('午餐做'+food);
            console.log('晚餐做'+food);
        }
    </script>
</body>
</html>